package com.bw.a2208douyindemo.login

import androidx.lifecycle.MutableLiveData
import com.bw.base.mvvm.BaseViewModel
import com.bw.bean.LoginBean
import com.bw.net.ApiService
import dagger.hilt.android.lifecycle.HiltViewModel
import okhttp3.RequestBody
import retrofit2.http.Query
import javax.inject.Inject
@HiltViewModel
class LoginViewModel @Inject constructor(
    val apiService: ApiService
) :BaseViewModel(){
    val loginSuccess by lazy { MutableLiveData<LoginBean>() }
    fun login(password:String,username:String){
        executeNewword(
            {apiService.login(password, username)},
            loginSuccess::postValue
        )
    }
}